package com.victor9ac.tfm.web.threadpool;

import java.util.concurrent.Callable;

import com.victor9ac.tfm.mashup.connector.exception.MashupConnectionException;
import com.victor9ac.tfm.mashup.connector.port.MashupConnector;

public class MashupTask<T> implements Callable<T> {

	
	private MashupConnector mashupConnector;


	private String resource;
	private Class<T> classGiven;
	
	
	public MashupTask(MashupConnector mashupConnector, String resource,
			Class<T> classGiven) {
		super();
		this.mashupConnector = mashupConnector;
		this.resource = resource;
		this.classGiven = classGiven;
	}


	@Override
	public T call() throws Exception {
		T res = null;
		try {
			res = mashupConnector.get(resource, classGiven);
		} catch (MashupConnectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return res;
	}
	


}
